//
//  DUMediator.h
//  APP
//
//  Created by duyujin1 on 2021/8/23.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN
@protocol DUDetailViewControllerProtocol <NSObject>
-(__kindof UIViewController *)detailViewControllerWithUrl:(NSString *)detailUrl;
@end

@interface DUMediator : NSObject
//target action
+(__kindof UIViewController *)detailViewControllerWithUrl:(NSString * )detailUrl;

//url scheme
typedef void(^DUMediatorPeocessBlock)(NSDictionary *pramas);
+(void)registerScheme:(NSString *)scheme processBlock:(DUMediatorPeocessBlock)processBlock;
+(void)openUrl:(NSString *)url pramas:(NSDictionary *)pramas;

//protocol class
+(void)registerProtocol:(Protocol *)proto class:(Class)cls;
+(Class)classForPortocol:(Protocol *)proto;

@end

NS_ASSUME_NONNULL_END
